package simpledemo.controller;

import com.cn.mvcfw.annotation.Autowired;
import com.cn.mvcfw.annotation.Controller;
import com.cn.mvcfw.annotation.RequestMapping;
import simpledemo.service.DemoService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by
 *
 * @author touni
 * @date 2019/3/27
 * @time 16:36
 */
@Controller
@RequestMapping("/demo")
public class DemoController {

    @Autowired
    private DemoService demoService;


    @RequestMapping("/test")
    public void test(HttpServletRequest request, HttpServletResponse response,String name) throws IOException {
        response.getWriter().println(name);



    }


    @RequestMapping("/testservice")
    public void testService(HttpServletRequest request, HttpServletResponse response,String name) throws IOException {
        String s = demoService.testService(name);
        response.getWriter().println(s);


    }








}
